package com.hotel.services.impl;

import com.hotel.daos.RoomMapper;
import com.hotel.entitys.Dept;
import com.hotel.entitys.Room;
import com.hotel.services.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author chend
 * @time 2022/02/28 11:46:04
 */

@Service
@Transactional
public class RoomServiceImpl implements RoomService {
    @Autowired
    private RoomMapper roomMapper;

    @Override
    public List<Room> selAllRoom(){
     return roomMapper.selAllRoom();
    }

    @Override
    public Integer setStatus(Integer room_id, Integer room_status) {
        return roomMapper.setStatus(room_id,room_status);
    }

    @Override
    public int updRoomStatus(Integer room_id) {
        return roomMapper.updRoomStatus(room_id);
    }

    @Override

    public List<Room> selRoomByNameorPhone(String keyword) {
        return roomMapper.selRoomByNameorPhone(keyword);
    }


    public Room selRoomById(Integer room_id) {
        return roomMapper.selRoomById(room_id);
    }

    //模态框查询
    @Override
    public List<Room> getAllRooms(String typeCheck,String statusCheck) {
        return roomMapper.selectAllRooms(typeCheck,statusCheck);
    }

    @Override
    public int cleanRoom(Integer room_id) {
        return roomMapper.updateCleanRoom(room_id);
    }


}
